package com.chinasoft.movies.mapper;

import com.chinasoft.movies.pojo.Top10MoviesInGenre;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Top10MoviesInGenreMapper {

    @Select("select title,revenue,popularity "+
    "from movies_top10_in_genre_by_revenue "+
    "where genre = #{genre} "+
    "union "+
    "select title,revenue,popularity "+
    "from movies_top10_in_genre_by_popularity "+
    "where genre = #{genre} "+
    "order by revenue desc,popularity desc ")
    List<Top10MoviesInGenre> queryTop10MoviesInGenre(String genre);
}
